﻿<UserControl x:Class="SellAvi.Views.ControlAdsActivator"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:converters="clr-namespace:SellAvi.Views.Converters"
             mc:Ignorable="d"
             DataContext="{Binding Activator, Source={StaticResource Locator}}"
             >
    <UserControl.Resources>
        <converters:InverseBooleanConverter x:Key="ibc" />       
    </UserControl.Resources>

    <Grid Margin="10,0,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="18" />
            <RowDefinition Height="18" />
            <RowDefinition Height="18" />
            <RowDefinition Height="18" />
            <RowDefinition Height="18" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <!-- Visibility="{Binding  Articles.IsNotCompleted, Converter={StaticResource btvc}}" -->
        <Button Grid.Row="0" Grid.Column="0"  Background="WhiteSmoke" Command="{Binding GetCategoriesCommand}" HorizontalContentAlignment="Left" Width="160" Padding="-2,1,-2,1" IsEnabled="{Binding ParseInProgress,Converter={StaticResource ibc}, Mode=OneWay}">
            <StackPanel Orientation="Horizontal">
                <Image Width="20" Source="/SellAvi;component/Resources/loop.png"></Image>
                <TextBlock Width="120" Text="Загр. неактивированные" FontSize="10"></TextBlock>
                <TextBlock Width="20" Text="{Binding PageCounter}" FontSize="10" ToolTip="Обработанное количество страниц кабинета"></TextBlock>
            </StackPanel>
        </Button>

        <StackPanel Width="160" Grid.Row="2" Grid.Column="0" Orientation="Horizontal">
            <TextBlock Width="120" Text="Задержка [cек.]" FontSize="10" TextAlignment="Left" Padding="15,0,0,0"></TextBlock>
            <TextBox Width="40" Text="{Binding ActivationSpeed}" FontSize="10" Margin="0" TextAlignment="Center"/>
        </StackPanel>
        <StackPanel Width="160" Grid.Row="3" Grid.Column="0" Orientation="Horizontal">
            <TextBlock Width="120" Text="Загружено" FontSize="10" TextAlignment="Left" Padding="15,0,0,0"></TextBlock>
            <TextBox Width="40" Text="{Binding UnactiveAdsCount}" FontSize="10" Margin="0,0,0,-0.4" TextAlignment="Center" Height="18" VerticalAlignment="Top" Background="#dddddd" BorderThickness="0"/>
        </StackPanel>

        <Button  Grid.Row="1" Grid.Column="0" Background="WhiteSmoke" IsEnabled="{Binding IsActivationEnabled, Mode=OneWay}" Command="{Binding ShowCategoriesCommand}" ToolTip="Выбор категорий для активации" HorizontalContentAlignment="Left" Width="160" Padding="-2,1,-2,1">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <Image Width="20" Source="/SellAvi;component/Resources/addressbook.png"></Image>
                <TextBlock Width="140" Text="Выбор категорий" FontSize="10"></TextBlock>
            </StackPanel>
        </Button>

        <!-- IsEnabled="{Binding ParseInProgress,Converter={StaticResource ibc}, Mode=OneWay}"-->
        <Button  Grid.Row="4" Grid.Column="0" Background="WhiteSmoke" IsEnabled="{Binding IsActivationEnabled, Mode=OneWay}" Command="{Binding ReActivateCommand}" ToolTip="Отправить завершенные объявления на активацию" HorizontalContentAlignment="Left" Width="160" Padding="-2,1,-2,1">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <Image Width="20" Source="/SellAvi;component/Resources/time.png"></Image>
                <TextBlock Width="140" Text="Запланировать активацию" FontSize="10"></TextBlock>
            </StackPanel>
        </Button>
    </Grid>
</UserControl>
